package com.toocms.jinjuhang.ui.commodity.detils

enum class OpenSpecificationAction(val code: String) {
    SELECTED("0"), //选择
    ADD_CART("1"), //添加购物车
    RECEIVE("2"), //领取
    CHANGE("3"); //兑换

    companion object {
        fun code2action(code: String?) = when (code) {
            SELECTED.code -> SELECTED
            ADD_CART.code -> ADD_CART
            RECEIVE.code -> RECEIVE
            CHANGE.code -> CHANGE
            else -> SELECTED
        }
    }
}